import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import { createPinia } from 'pinia';

// 懒加载插件
import Vue3LazyLoad from 'vue3-lazyload';

// 引入vant
// import Vant from 'vant';
import 'vant/lib/index.less';
import 'lib-flexible/flexible';
import { useVantUI } from './plugins/vant';

// 重置样式表、图标
import './assets/css/normalize.css';
import './assets/css/theme/black.css';
import './assets/css/iconfont/iconfont.css';

// pinia
const pinia = createPinia();
// pinia.use(({ store }) => {
//   store.$subscribe((x) => {
//     // 在存储变化的时候执行
//     console.log(x);
//   });
//   store.$onAction((x) => {
//     // 在 action 的时候执行
//     console.log(x);
//   });
// });

const app = createApp(App);
// app.use(Vant);
useVantUI(app);
app.use(Vue3LazyLoad, {
  error: require('./assets/img/icon_me.jpg'),
  loading: require('./assets/img/icon-loading.gif')
});
app.use(pinia);
app.use(router);
app.mount('#app');
